package com.cn.stusy0015.demo0021;

/**
 * @author lw
 * @ClassName StuData.java
 * @Description
 * @createTime 2023年05月21日 16:11:00
 */
public class StuData {
    Student[] stus = new Student[30];

    public void stuadd(Student stu) {
        for (int i = 0; i < stus.length; i++) {
            if (stus[i] == null) {
                stus[i] = stu;
                break;
            }
        }
    }

    public void showStu() {
        for (int i = 0; i < stus.length; i++) {
            if (stus[i] != null) {
                System.out.println(stus[i].getSid() + "\t" + stus[i].getSname()
                        + "\t" + stus[i].getAge() + "\t" + stus[i].getCla());
            }
        }
    }
}
